<form method="post" enctype="multipart/form-data" target="_blank" id="goods_list_form">
    <div class="table-responsive">
        <table class="table table-bordered table-hover">
            <thead> 
            <tr>
                <td style="width: 1px;" class="text-center">
                </td>    
                <td class="text-right">
                    <a href="javascript:sort('goods_id');">ID</a>
                </td>
                <td class="text-left">
                    <a href="javascript:sort('goods_name');">商品名称</a>
                </td>  
                <td class="text-left">
                   活动名称
                </td> 
                 <td class="text-left">
                   原价
                </td>
                <td class="text-left">
                   折扣率(一口价)
                </td>
                <td class="text-left">
                    <a href="javascript:;">店铺名</a>
                </td>
				<td class="text-left">
				    <a href="javascript:sort('shop_price');">所属分类</a>
				</td>
               
                <td class="text-left">
                    <a href="javascript:sort('goods_state');">状态</a>
                </td>
                 <td class="text-left">
                    <a href="javascript:sort('prom_lock');">是否禁止活动</a>
                </td>
				<td class="text-center">
                    上架时间
                </td>
                <td class="text-center">
                    促销时间
                </td>
				<td class="text-left">
                    <a href="javascript:sort('goods_state');">操作</a>
                </td>  
            </tr>
            </thead>
            <tbody>
            <volist name="goodsList" id="list">
                <tr>
                  <td class="text-center">
                       <input type="checkbox" name="goods_id[]" value="{$list.goods_id}"/>
                    </td>
                    <td class="text-right">{$list.goods_id}</td>
                    <td class="text-left"><img src="{$list.original_img}" height="50" style="cursor: pointer;" onmouseover="layer.tips('<img src={$list.original_img} width=180>',this,{tips: [1, '#EAF8FF']});" onmouseout="layer.closeAll();">  <span onmouseover="layer.tips('关键词:{$list.keywords}',this,{tips: [1, '#000']});" onmouseout="layer.closeAll();">{$list.goods_name|getSubstr=0,33}</span></td>
					 <td class="text-center">{$parse_type[$list[prom_type]]}</td> 
					 <td class="text-center">{$list[shop_price]}</td> 
					 <td class="text-center">{$list[expression]}</td> 
                   
                    <td class="text-left"><a href="/index.php/Seller/Admin/login/store_id/{$list.store_id}" target="_blank" title="进入商家后台">{$list.store_name}</a></td>
					<td class="text-left">{$list.goods_type_name}</td>
                     <td class="text-left">
                    	 <span onmouseover="layer.tips('{$list.zhuangtai}',this,{tips: [1, '#000']});" onmouseout="layer.closeAll();">
                     <if condition="$list[goods_state] eq 0">待审核</if>
                     <if condition="$list[goods_state] eq 1">审核通过</if>
                     <if condition="$list[goods_state] eq 2">审核失败</if>
                     <if condition="$list[goods_state] eq 3">违规下架</if>
                     </span>
                     </td>
                       <td class="text-left">
                    	<if condition='$list[prom_lock] eq 1'>
                    	    <span style="color:red;">禁止活动</span>
                    	    <else/>
                    	    <span style="color:green;">允许活动</span>
                    	    
                    	    </if>
                      </td>
  <td class="text-left">
	  {$list.on_time|date='Y-m-d H:i:s',###}
  </td>
    <td class="text-left">
	  {$list.start_time}
  </td>
  <td class="text-left">
	  <a href="javascript:;" rel="{$list.goods_id}" rev="{$list.store_id}" data-toggle="tooltip" id="xiugai" class="btn btn-primary" data-original-title="修改"><i class="fa fa-pencil"> 添加活动</i></a>
	  <if condition='$list.time_status eq 1'>
	  <a href="quxiaoprom_goods/goods_id/{$list.goods_id}" data-toggle="tooltip" id="xiugai" class="btn btn-danger" data-original-title="修改"><i class="fa fa-pencil"> 删除</i></a>
	  </if>
  </td>
                </tr>
            </volist>
            </tbody>
        </table>
    </div>
</form>
<div class="row">
    <div class="navbar-form form-inline">
        全选
        <input type="checkbox" onclick="$('input[name=\'goods_id\[\]\']').prop('checked', this.checked);">
        <!--<div class="form-group">-->
        <!--    <select id="func_id" class="form-control" style="width: 120px;" onchange="fuc_change(this);">-->
        <!--        <option value="-1">请选择...</option>-->
        <!--        <option value="0">推荐</option>-->
        <!--        <option value="1">新品</option>-->
        <!--        <option value="2">热卖</option>-->
        <!--        <option value="3">审核商品</option>-->
        <!--    </select>-->
        <!--</div>-->
        <!--<div class="form-group" id="state_div" >-->
        <!--    <select id="state_id" class="form-control" style="display: none" onchange="state_change(this);">-->
        <!--        <option value="">请选择...</option>-->
        <!--        <foreach name="goods_state" item="vo" >-->
        <!--            <option value="{$key}">{$goods_state[$key]}</option>-->
        <!--        </foreach>-->
        <!--    </select>-->
        <!--</div>-->
        <button id="act_button" type="button" onclick="act_submit();" class="btn btn-primary "><i class="fa"></i> 批量设置折扣</button>
    </div>
    <div class="col-sm-9 text-right">{$page}</div>
</div>
<script>
    // 点击分页触发的事件   
	$(".pagination  a").click(function(){
        cur_page = $(this).data('p');
        ajax_get_table('search-form2',cur_page);
    });
	
    $(".table-responsive #xiugai").click(function(){
		var myrel=$(this).attr('rel');
// 		var store_id=$(this).attr('rev');
		var myrul='/index.php/Admin/Promotion/prom_goods_id_info/goods_id/'+myrel;//+myrel;
		$.get(myrul,function(e){
			layer.open({
			  type: 2,
			  shadeClose: true, //点击遮罩关闭
			  title:'添加活动',
			  skin: 'layui-layer-rim', //加上边框
			  area: ['80%', '80%'], //宽高
			  content: myrul
			});
		})
    });
	
	$(".table #picshow").click(function(){
		var mypic=$(this).attr('src');
		  layer.photos({
		    photos: {
				  "data": [
					{
					  "alt": "产品主图",
					  "src": mypic,
					}],
					}
		    ,anim: 5 //0-6的选择，指定弹出图片动画类型，默认随机
		  });
	});
	
	function fenbuKuncun(goods_id){
	    layer.open({
			  type: 2,
			  shadeClose: true, //点击遮罩关闭
			  title:'分部库存和排序',
			  skin: 'layui-layer-rim', //加上边框
			  area: ['920px', '620px'], //宽高
			  content: '{:U('Admin/Goods/fenbuKuncun')}?goods_id='+goods_id
			});
	}
	function fenbukoudian(goods_id){
	    layer.open({
			  type: 2,
			  shadeClose: true, //点击遮罩关闭
			  title:'分部扣点设置',
			  skin: 'layui-layer-rim', //加上边框
			  area: ['920px', '620px'], //宽高
			  content: '{:U('Admin/Goods/fenbukoudian')}?goods_id='+goods_id
			});
	}
</script>